package com.qing.spark.dao

import java.io.IOException

//import org.apache.hadoop.conf.Configuration
//import org.apache.hadoop.hbase.HBaseConfiguration
//import org.apache.hadoop.hbase.client.{HBaseAdmin, HTable}

/**
  * Created by wuliao on 2018/3/13.
  */
object HBaseUtils {
  private var instance: HBaseUtils = null

  def getInstance: HBaseUtils = {
    if (null == instance)
      instance = new HBaseUtils
    instance
  }
}

class HBaseUtils {
//  val conf = HBaseConfiguration.create()
//
//  conf.set("hbase.master", "impala01:60000")
//  conf.set("hbase.zookeeper.quorum", "impala02,impala03,impala04")
//
//  try {
//    val admin = new HBaseAdmin(conf)
//  } catch {
//    case e: Exception => {
//      e.printStackTrace()
//    }
//  }
  //    conf.set("hbase.master", "127.0.0.1:60000")
  //    conf.set("hbase.zookeeper.quorum", "127.0.0.1:2181")

//  def getTable(tableName: String): HTable = {
//    var table: HTable = null
//    try {
//      table = new HTable(conf, tableName)
//    }
//    catch {
//      case e: Exception => {
//        e.printStackTrace()
//      }
//    }
//    table
//  }
}
